package logic;
public class ChunkMessage {
	private String fileID;
	private int chunkNo;
	private long date;
	private byte[] content;
	private String version;
	public ChunkMessage(){
		fileID=null;
		chunkNo=-1; 
		this.setDate(System.currentTimeMillis());
		content=null;
		version=null;
		
	}
	public ChunkMessage(String fileID,int chunkNo){
		this.fileID=fileID;
		this.chunkNo=chunkNo;
	 	this.setDate(System.currentTimeMillis());
	 	this.content=null;
	 	this.version=null;
	}
	public ChunkMessage(String fileID,int chunkNo, byte[] content, String version){
		this.fileID=fileID;
		this.chunkNo=chunkNo;
	 	this.setDate(System.currentTimeMillis());
	 	this.content=content;
	 	this.version=version;
	}
	public String getFileID() {
		return fileID;
	}
	public void setFileID(String fileID) {
		this.fileID = fileID;
	}
	public int getChunkNo() {
		return chunkNo;
	}
	public void setChunkNo(int chunkNo) {
		this.chunkNo = chunkNo;
	}
	public long getDate() {
		return date;
	}
	public void setDate(long date) {
		this.date = date;
	}
	public byte[] getContent() {
		return content;
	}
	public void setContent(byte[] content) {
		this.content = content;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public boolean equals(Object o)
	{
		if(this.getFileID().equals(((ChunkMessage)o).getFileID()) && this.getChunkNo()==((ChunkMessage)o).getChunkNo())
			return true;
		return false;
	}
}
